
@extends('layout.layer')

@section('stylesheet')
<link href="//cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/bootstrap-daterangepicker/2.1.27/daterangepicker.min.css" rel="stylesheet">
@stop

@section('layout.content') 
<div class="row">
  <form class="form-horizontal" id="coupon-create" autocomplete="off">
    <input type="hidden" name="date_begin" value="" />
    <input type="hidden" name="date_end" value="" />
  <div class="col-sm-6">
    <div class="form-group">
      <label class="col-sm-3 control-label b" for="name"> <span class="red">*</span> 名称</label>
      <div class="col-sm-9">
          <input type="text" class="form-control" name="name" placeholder="优惠券名称" />
      </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label b" for="type"> <span class="red">*</span> 类型</label>
        <div class="col-sm-9" style="margin-left:-10px;">
            <div class="checkbox">
              <label>
                <input name="type" type="checkbox" value="1" data-target="t1" class="ace ace-checkbox-2" />
                <span class="lbl"> 满减券</span>
              </label>
              <label>
                <input name="type" type="checkbox" value="2" data-target="t2" class="ace ace-checkbox-2" />
                <span class="lbl"> 折扣券</span>
              </label>  
              <label>
                <input name="type" type="checkbox" value="3" data-target="t3" class="ace ace-checkbox-2" />
                <span class="lbl"> 抵用券</span>
              </label>
            </div>
        </div>       
    </div>

    <div class="form-group type t1" style="display:none;">
      <label class="col-sm-3 control-label b" for="type"> 满减规则</label>
      <div class="col-sm-9">
        <label style="float:left;width:30px;margin:6px 0 0;"> 满</label>
        <input type="text" class="form-control" name="least" placeholder="金额" style="float:left;width:80px;" />      
        <label style="float:left;width:40px;margin:6px 0 0 15px;"> 元减</label>
        <input type="text" class="form-control" name="reduce" placeholder="金额" style="width:80px;" />
      </div>     
    </div>

    <div class="form-group type t2" style="display:none;">
      <label class="col-sm-3 control-label b" for="type"> 折扣比例</label>
      <div class="col-sm-9">
        <input type="text" class="form-control form-input" name="discount" placeholder="折扣" style="float:left;width:70px;" />        
        <label style="float:left;margin:6px 0 0 5px;"> %</label>      
        <label style="float:left;width:40px;margin:6px 0 0 15px;"> 上限</label>
        <input type="text" class="form-control form-input" name="limited" placeholder="金额" style="float:left;width:80px;" />
        <label style="width:30px;margin:6px 0 0 5px;"> 元</label>
      </div>
    </div>

    <div class="form-group type t3" style="display:none;">
      <label class="col-sm-3 control-label b" for="type"> 抵用金额</label>
      <div class="col-sm-9">        
        <input type="text" class="form-control form-input" name="voucher" placeholder="金额" style="float:left;width:70px;" />
        <label style="width:45px;margin:6px 0 0 5px;"> 元</label>
      </div>       
    </div>

    <div class="form-group">
        <label class="col-sm-3 col-xs-12 control-label b" for="effect"> <span class="red">*</span> 有效期</label>
        <div class="col-sm-9 col-xs-12" style="margin-left:-10px;">
            <div class="checkbox">
              <label>
                <input name="effect" type="checkbox" value="2" data-target="effect2" class="ace ace-checkbox-2" />
                <span class="lbl"> 指定时段</span>
              </label>
              <label>
                <input name="effect" type="checkbox" value="1" data-target="effect1" class="ace ace-checkbox-2" />
                <span class="lbl"> 固定时长</span>
              </label>
            </div>
        </div>
    </div>
    <div class="form-group effect effect2" style="display:none;">
        <label class="col-sm-3 col-xs-12 control-label"> </label>
        <div class="col-sm-9 col-xs-12">
            <label style="float:left;width:70px;margin:6px 0 0;"> 生效时间</label>
            <input type="text" class="form-control form-input" name="date_range" id="date_range" style="float:left;width:220px;" />
        </div>
    </div>
    <div class="form-group effect effect1" style="display:none;">
        <label class="col-sm-3 control-label"> </label>
        <div class="col-sm-9">
            <label style="float:left;width:165px;margin:6px 0 0;"> 领取当天生效，有效天数</label>
            <input type="text" class="form-control" name="date_n" placeholder="天数" style="width:80px;" />
        </div>
    </div>

  </div>

  <div class="col-sm-6">
    <div class="form-group">
      <label class="col-sm-3 control-label b" for="scope"> <span class="red">*</span> 使用范围</label>
      <div class="col-sm-9" style="margin-left:-10px;">
        <div class="checkbox">
          <label>
            <input name="scope" type="checkbox" value="1" class="ace ace-checkbox-2" />
            <span class="lbl"> 通用券</span>
          </label>
          <label>
            <input name="scope" type="checkbox" value="2" class="ace ace-checkbox-2" />
            <span class="lbl"> 店铺券</span>
          </label>  
          <label>
            <input name="scope" type="checkbox" value="3" class="ace ace-checkbox-2" />
            <span class="lbl"> 品类券</span>
          </label>
          <label>
            <input name="scope" type="checkbox" value="3" class="ace ace-checkbox-2" />
            <span class="lbl"> 单品券</span>
          </label>       
        </div>
      </div>       
    </div>

    <div class="form-group">
      <label class="col-sm-3 control-label b"> <span class="red">*</span> 指定分类 </label>
      <div class="col-sm-9">
        <div class="col-sm-6">
          <select class="form-control parent" name="parent_category" size="5">
          </select>
        </div>
          
        <div class="col-sm-6">
          <select class="form-control child" name="child_category" size="5">
          </select>
        </div>

      </div>       
    </div>
  
  </div>

  
  <hr style="clear:both;" />
  <div class="col-xs-12 center">
    <div class="form-group">      
        <button type="button" class="btn btn-primary submit">
          <i class="ace-icon fa fa-check"></i>
          <span class="">确定</span>
        </button>
        <button type="button" class="btn btn-grey cancel" style="margin-left: 10px;">
          <i class="ace-icon fa fa-close"></i>
          <span class="">取消</span>
        </button>
    </div>
  </div>
</form>
</div>

@stop

@section('javascript')
<script src="//cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="//cdn.bootcss.com/moment.js/2.24.0/moment.min.js"></script>
<script src="//cdn.bootcss.com/moment.js/2.24.0/locale/zh-cn.js"></script>
<script src="//cdn.bootcss.com/bootstrap-daterangepicker/2.1.27/daterangepicker.min.js"></script>
<script src="//cdn.bootcdn.net/ajax/libs/jquery-validate/1.9.0/jquery.validate.min.js"></script>
<script src="//cdn.bootcdn.net/ajax/libs/jquery-validate/1.9.0/additional-methods.min.js"></script>
<script src="//cdn.bootcdn.net/ajax/libs/jquery-validate/1.9.0/localization/messages_cn.js"></script>
<script>
  var categories = $.parseJSON('{!!$categories!!}');
</script>
<script src="{{ stamp('assets/js/hms-coupon.js') }}"></script>
<script type="text/javascript">
  $(function() {

        
  });
</script>
@stop